Release 10.1A: OpenEdge Application Server:
Developing WebSpeed Applications
set-cookie
This function sets a persistent state cookie in the Web browser by outputting an HTTP
Location:Set-Cookieheader with specified options. The Web browser on future requests sends the name and associated value of the cookie automatically. This is especially useful for preserving state information between requests.web\method\cookies.iParameters:INPUT p_name AS CHARACTERThe name of the cookie.
INPUT p_value AS CHARACTERThe value of the cookie.
INPUT p_date AS DATEThe optional expiration date (local). If the Unknown value (
?) is specified, the cookie expires when the browser session ends.INPUT p_time AS INTEGERThe optional expiration time (local) as a number of seconds since midnight. This parameter only has meaning if p_date is not the Unknown value (
?). If you do not want to set a specific time, specify the Unknown value (?).INPUT p_path AS CHARACTERThe URL path to which the cookie should apply. If Unknown value (
?) is specified, the value of theDefaultCookiePathconfiguration option is used or, if that is not set, the value of theAppURLglobal variable.INPUT p_domain AS CHARACTERThe optional domain to which the cookie should apply. If Unknown value (
?) is specified, value of theDefaultCookieDomainconfiguration option is used or, if that is not set, the domain option is not set on the cookie. In that case, the current hostname of the Web server is used by the Web browser.INPUT p_options AS CHARACTERA comma-delimited list of options. The valid values are as follows:
- Secure — If specified, the Web browser only sends the Cookie back when on a secure (SSL) connection (using HTTPS).
- Local — (Default) Assume date and time are based on local time and need conversion to UTC.
Returns: CHARACTER Notes:- UTC — Assume date and time are UTC based eliminating any conversion that would otherwise be required from local time to UTC time.
- If the p_time expression is a very large or small number (greater or less than the number of seconds in a day), it is normalized to fit within a day. In this case, the expiration date is incremented or decremented as appropriate.
- Because of possible differences between the user’s machine and your server’s clocks, cookies based on functions like TIME might not expire exactly when you expect them to expire.
- Requires a browser supporting persistent state cookies. Other browsers should ignore the HTTP
Set-Cookieheader.- Cookies must be set within the HTML header. Therefore, for all practical purposes, all cookies must be defined prior to the first call to the
output-content-typefunction.Examples:- Before using cookies, you should read the standards published for the various Web servers.
See also:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |